import 'package:flutter/material.dart';

import '../res.dart';

class DBorderButton extends StatelessWidget {
  final String text;
  final double width;
  final double height;
  final double borderRadius;
  final double fontSize;
  final Color fontColor;
  final Color borderColor;
  final Function onTap;
  DBorderButton(this.text,
      {this.width, this.height, this.borderRadius, this.borderColor,this.fontColor,this.fontSize,this.onTap});

  @override
  Widget build(BuildContext context) {
    final br = borderRadius ?? 4.dp;
    final bc = borderColor ?? Color(0xffC2C2C2);
    final fs=fontSize??14.sp;
    final fc=fontColor??Color(0xff302F2F);
    return GestureDetector(
      onTap: onTap,
      child: Container(
        width: width,
        height: height,
        decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.circular(br),
            border: Border.all(color: bc)),
        child: Center(
          child: Text(
            text,
            style: resTextStyle.copyWith(fontSize: fs,color: fc),
          ),
        ),
      ),
    );
  }
}

class DMainButton extends StatelessWidget {
  final String text;
  final double width;
  final double height;
  final double fontSize;
  final double borderRadius;
  final Function onTap;

  DMainButton(this.text, this.width, this.height,
      {this.fontSize, this.borderRadius, this.onTap});

  @override
  Widget build(BuildContext context) {
    final br = borderRadius ?? 4.dp;
    final fs = fontSize ?? 14.sp;
    return GestureDetector(
      onTap: onTap,
      child: Container(
        width: width,
        height: height,
        alignment: Alignment.center,
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(br),
            gradient: LinearGradient(colors: [Color(0xffEF3E35), resMainColor])),
        child: Text(text,style: resTextStyle.copyWith(fontSize: fs,color: Colors.white),),
      ),
    );
  }
}
